<?php $this->load->view('layout/header'); ?>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <h3 class="page-title">旅游产品
                <small> 类别管理</small>
            </h3>
            <?php echo breadcrumb(array('tourismgoods/grid' => '旅游产品', 'tourismgoodscategory/grid' => '类别管理')); ?>
        </div>
    </div>
    <?php echo execute_alert_message() ?>
    <?php echo warning_alert_message('“级别”设为一级分类时，“上级分类”必须留空；“级别”设为二级分类时，“上级分类”必须选中一个并且只能选中一个；“级别”设为三级分类时，“上级分类”必须选中二个。')?>
    <div class="row-fluid">
        <div class="span12">
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption"><i class="icon-plus-sign"></i>类别添加</div>
                    <div class="tools">
                        <a class="collapse" href="javascript:;"></a>
                        <a class="remove" href="javascript:;"></a>
                    </div>
                </div>
                <div class="portlet-body form">
                    <form class="form-horizontal line-form" action="<?php echo base_url('tourismgoodscategory/editPost') ?>" method="post" enctype="multipart/form-data">
                        <div class="control-group">
                            <label class="control-label"><em>* </em>类别名</label>
                            <div class="controls">
                                <input type="hidden" name="id" value="<?php echo $category->id;?>">
                                <input type="text" name="name" value="<?php echo $category->name;?>" class="m-wrap large required">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label"><em>* </em>级别</label>
                            <div class="controls">
                                <select class="m-wrap large required" name="level">
                                    <option value="">请选择</option>
                                    <?php foreach ($level as $k=>$v) :?>
                                    <option value="<?php echo $k ?>" <?php if ($k == $category->level): ?>selected="selected"<?php endif?>><?php echo $v ?></option>
                                    <?php endforeach;?>
                                </select>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">上级分类</label>
                            <div class="controls">
                                <?php $this->load->view('commonhtml/categorySelect1');?>
                            </div>
                        </div>
                        <div class="form-actions">
                            <button class="btn green" type="submit"><i class="icon-ok"></i> 保存</button>
                            <a href="<?php echo base_url('tourismgoodscategory/grid') ?>">
                                <button class="btn" type="button">返回</button>
                            </a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $this->load->view('layout/footer'); ?>